/*
 *  Copyright 2009 David Kuhn <david.s.kuhn at gmail.com>.
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *  under the License.
 */
package com.google.code.teamtools.domain.impl;

import com.google.code.teamtools.domain.ISkill;
import com.google.code.teamtools.domain.ISkillCategory;

/**
 * Skill implementation.
 * 
 * @author David Kuhn
 */
public class Skill implements ISkill
{
	private Long id = null;
	private String name;
	private ISkillCategory skillCategory;
	
	public Skill()
	{
	}
	
	public Skill(String name)
	{
		setName(name);
	}
	
	public Skill(Long id, String name)
	{
		this(name);
		setId(id);
	}

	/* (non-Javadoc)
	 * @see com.google.code.teamtools.domain.IEntity#getId()
	 */
	public Long getId()
	{
		return id;
	}

	/* (non-Javadoc)
	 * @see com.google.code.teamtools.domain.ISkill#getName()
	 */
	public String getName()
	{
		return name;
	}
	
	/* (non-Javadoc)
	 * @see com.google.code.teamtools.domain.ISkill#getSkillCategory()
	 */
	public ISkillCategory getSkillCategory()
	{
		return skillCategory;
	}

	/* (non-Javadoc)
	 * @see com.google.code.teamtools.domain.ISkill#setName(java.lang.String)
	 */
	public void setName(String name)
	{
		this.name = name;
	}
	
	/* (non-Javadoc)
	 * @see com.google.code.teamtools.domain.ISkill#setSkillCategory(com.google.code.teamtools.domain.ISkillCategory)
	 */
	public void setSkillCategory(ISkillCategory skillCategory)
	{
		this.skillCategory = skillCategory;
	}
	
	public String toString()
    {
        StringBuilder sb = new StringBuilder();
        sb.append("Skill[");
        sb.append("id:");
        sb.append(this.getId());
        sb.append("|name:");
        sb.append(this.getName());
        sb.append("|skillCategory:");
        sb.append(this.getSkillCategory().toString());
        sb.append("]");
        
        return sb.toString();
    }
	
	private void setId(Long id)
	{
		this.id = id;
	}
}
